package com.wiscamp.ninechapters.panels.domain.enums;

public enum RoleTypes {
    None("无", 0),
    ControlPanelsAdmin("控制面板管理员", 105001),
    ControlPanelsRole("控制面板普通角色", 105002),
    ApplicationAdmin("应用管理员", 105003),
    ApplicationRole("应用普通角色", 105004),
    ApplicationTenantSharedRole("应用租户共享角色", 105005),
    TenantAdmin("租户管理员", 105006),
    TenantRole("租户普通角色", 105007);

    private String name;
    private int index;

    // 构造方法
    private RoleTypes(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(int index) {
        for (RoleTypes c : RoleTypes.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    // get set 方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
